package model;

import java.util.ArrayList;

public class User {
	private String name;
	private String passwd;
	private ArrayList<Sell> sells = new ArrayList<Sell>();
	
	public User(String name, String passwd){
		this.name = name;
		this.passwd = passwd;
	}
	
	public String getName() {
		return name;
	}
	
	public void setNome(String name) {
		this.name = name;
	}
	
	public String getPassword() {
		return passwd;
	}
	
	public void setPassword(String passwd) {
		this.passwd = passwd;
	}
	
	public ArrayList<Sell> getAllSells(){
		return sells;
	}
	
	public int getSellQuantity(){
		return sells.size();
	}
	
	public void addSell(Sell sell){
		sells.add(sell);
	}
	
	public void removeSell(Sell sell){
		sells.remove(sell);
	}
	
	public Sell getSell(int ID){
		for(Sell sell: sells){
			if (sell.getID() == ID)
				return sell;
		}
		return null;
	}
}
